import request from "@/utils/request";

// 获取部门树 错误码 20080
export function getDepttree(params) {
  return request({
    url: "/dingTalk/sysDingTalkOrganizationTree",
    method: "get",
  });
}

// 分页获取单位下所有员工职位信息 错误码 20081
export function list(params) {
  return request({
    url: "/dingTalk/list",
    method: "get",
    params,
  });
}

// 绑定  错误码 20082
export function bindingDing(data) {
  return request({
    url: "/dingTalk/bind",
    method: "put",
    data,
  });
}

// 用户昵称模糊搜索  错误码 20083
export function getNickname(params) {
  return request({
    url: "/system/user/search?nickName=" + params,
    method: "get",
  });
}

// 解绑 错误码 20084
export function putUnbundle(data) {
  return request({
    url: "/dingTalk/unbinding?code=" + data,
    method: "put",
    // data,
  });
}

// 同步数据  错误码 20089
export function syncDing() {
  return request({
    url: "/dingTalk/synchronousData",
    method: "put",
  });
}

export function getDetail(params) {
  return request({
    url: "/dingInfo/listEmployeePositions/?code=" + params + "",
    method: "get",
  });
}
